<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/9
  Time: 8:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%--四大作用域
  pageScope
  requestScope
  sessionScope
  applicationScope


  --%>

<%
//    page--> PageContext  只在当前 scope-page.jsp中使用
    pageContext.setAttribute("name","zhangsan");
    pageContext.setAttribute("findKey","PageValue- zhangsan");



%>



<%--动作和标签中使用--%>
<%=pageContext.getAttribute("name")%>   <br>

<%--findAttribute  到四个作用域中查找  对应可以 的 value
    page>request>session>application

 --%>
pageContext.findAttribute("findKey") :  <%=pageContext.findAttribute("findKey")%> <br>

<h3>getAttributesScope</h3>

<%
//    PageContext.APPLICATION_SCOPE 4
//    PageContext.SESSION_SCOPE 3
//    PageContext.REQUEST_SCOPE 2
//    PageContext.PAGE_SCOPE 1
%>
<%--1
    2
    3
    4
--%>
pageContext.getAttributesScope("skey"):  <%=pageContext.getAttributesScope("skey")%> <br>
pageContext.getAttribute("findKey",PageContext.SESSION_SCOPE) :  <%=pageContext.getAttribute("findKey",PageContext.SESSION_SCOPE)%> <br>
pageContext.getAttribute("findKey",PageContext.REQUEST_SCOPE) :  <%=pageContext.getAttribute("findKey",PageContext.REQUEST_SCOPE)%> <br>


</body>
</html>
